package com.apt.action;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import com.apt.domain.TestMaster;
import com.apt.load.LoadQuestions;

public class LoadTestAction extends AptBaseAction {

	private File upload;
	private String uploadContentType;
	private String uploadFileName;
	private String testName;
	private Integer selectedTestType;
	private String disabled;
	private Integer duration;
	


	public String getDisabled() {
		return disabled;
	}

	public void setDisabled(String disabled) {
		this.disabled = disabled;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	public Integer getSelectedTestType() {
		return selectedTestType;
	}

	public void setSelectedTestType(Integer selectedTestType) {
		this.selectedTestType = selectedTestType;
	}

	public String loadTest() {
		try{
			/*System.out.println("testname - ? "+testName);
			System.out.println("test type - ? "+selectedTestType);
			System.out.println("disabled - "+disabled);
			System.out.println("duration - "+duration);*/
			TestMaster tm = new TestMaster(testName, selectedTestType, disabled, duration, upload);
			LoadQuestions lq = new LoadQuestions();
			lq.loadQuestions(tm);
			
			
			  
		}catch (Exception ex) {
			addActionError(ex.getMessage());
			return "error";

		}
		
		
		return SUCCESS;
	}

	public String getTestName() {
		return testName;
	}

	public void setTestName(String testName) {
		this.testName = testName;
	}

	public File getUpload() {
		return upload;
	}

	public void setUpload(File upload) {
		this.upload = upload;
	}

	public String getUploadContentType() {
		return uploadContentType;
	}

	public void setUploadContentType(String uploadContentType) {
		this.uploadContentType = uploadContentType;
	}

	public String getUploadFileName() {
		return uploadFileName;
	}

	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}

	

}
